import VueRouter from 'vue-router'

// 引入监听的组件
// 首页
 import HomeContainer from './components/HomeContainer.vue'
//  新闻资讯列表页
 import NewsContainer from './components/news/NewsContainer.vue'
//  新闻详情页组件
import NewsInfo from './components/news/NewsInfo.vue'
// 图片列表页组件引入
import PhotoList from './components/photo/PhotoList.vue'
// 图片列表详情页组件引入
import PhotoInfo from './components/photo/PhotoInfo.vue'
// 会员页面组件
 import MemberContainer from './components/MemberContainer.vue'
// 购物车页面组件
 import ShopcarContainer from './components/ShopcarContainer.vue'
//  引入商品列表页组件
import ShopList from './components/buy/ShopList.vue'
// 商品详情页列表
import GoodInfo from './components/buy/goodsInfo.vue'
// 图文介绍页面
import GoodDesc from './components/buy/goodsDesc.vue'
// 评论详情页面
import CommentReason from "./components/buy/commentReason.vue"
//  搜索页面组件
 import SearchContainer from './components/SearchContainer.vue'



// 3. 创建路由对象
   var router = new VueRouter({
     routes:[
       {path: '/',redirect: '/shopcar'},
       {path: '/home', component: HomeContainer},
       {path:'/home/news', component: NewsContainer},
       {path:'/home/newsinfo/:id', component: NewsInfo},
       {path: '/member', component: MemberContainer},
       {path: '/home/photos', component: PhotoList},
       {path: '/home/photoinfo/:id',component: PhotoInfo},
       {path: '/home/ShopList', component: ShopList},
       {path: '/home/goodsInfo/:id', component: GoodInfo},
       {path: '/home/goodsdesc/:id', component: GoodDesc, name:"goodsdesc"},
       {path: '/home/commentReason/:id',component: CommentReason},
       {path: '/shopcar', component: ShopcarContainer},
       {path: '/search', component: SearchContainer},
     ],
     linkActiveClass: "mui-active",
   }); 

// 把路由对象暴露出去
export default router